.class final Lcom/ninesky/browser/provider/c;
.super Ljava/lang/Thread;


# instance fields
.field private a:Landroid/content/ContentResolver;

.field private b:Z


# direct methods
.method constructor <init>(Landroid/content/ContentResolver;)V
    .locals 1

    invoke-direct {p0}, Ljava/lang/Thread;-><init>()V

    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/ninesky/browser/provider/c;->b:Z

    iput-object p1, p0, Lcom/ninesky/browser/provider/c;->a:Landroid/content/ContentResolver;

    return-void
.end method


# virtual methods
.method public final a()Z
    .locals 1

    iget-boolean v0, p0, Lcom/ninesky/browser/provider/c;->b:Z

    return v0
.end method

.method public final run()V
    .locals 7

    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/ninesky/browser/provider/c;->b:Z

    new-instance v2, Ljava/util/HashMap;

    invoke-direct {v2}, Ljava/util/HashMap;-><init>()V

    const/4 v0, 0x0

    :try_start_0
    iget-object v1, p0, Lcom/ninesky/browser/provider/c;->a:Landroid/content/ContentResolver;

    invoke-static {v1}, Lcom/ninesky/browser/provider/b;->a(Landroid/content/ContentResolver;)Landroid/database/Cursor;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_1

    move-result-object v3

    if-eqz v3, :cond_0

    :try_start_1
    invoke-interface {v3}, Landroid/database/Cursor;->moveToFirst()Z

    :goto_0
    invoke-interface {v3}, Landroid/database/Cursor;->isAfterLast()Z
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    move-result v0

    if-eqz v0, :cond_2

    :cond_0
    if-eqz v3, :cond_1

    invoke-interface {v3}, Landroid/database/Cursor;->close()V

    :cond_1
    invoke-virtual {v2}, Ljava/util/HashMap;->values()Ljava/util/Collection;

    move-result-object v0

    invoke-virtual {v2}, Ljava/util/HashMap;->size()I

    move-result v1

    new-array v1, v1, [Lcom/ninesky/browser/provider/g;

    invoke-interface {v0, v1}, Ljava/util/Collection;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;

    move-result-object v0

    check-cast v0, [Lcom/ninesky/browser/provider/g;

    invoke-static {v0}, Lcom/ninesky/browser/provider/g;->a([Lcom/ninesky/browser/provider/g;)V

    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/ninesky/browser/provider/c;->b:Z

    return-void

    :cond_2
    const/16 v0, 0xb

    :try_start_2
    invoke-interface {v3, v0}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v0

    if-eqz v0, :cond_3

    const-string v1, ""

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-nez v1, :cond_3

    const/4 v1, 0x2

    invoke-interface {v3, v1}, Landroid/database/Cursor;->getInt(I)I

    move-result v4

    const-string v1, ","

    invoke-static {v0, v1}, Lcom/ninesky/a/b;->a(Ljava/lang/String;Ljava/lang/String;)Ljava/util/Vector;

    move-result-object v0

    invoke-virtual {v0}, Ljava/util/Vector;->iterator()Ljava/util/Iterator;

    move-result-object v5

    :goto_1
    invoke-interface {v5}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-nez v0, :cond_5

    :cond_3
    invoke-interface {v3}, Landroid/database/Cursor;->moveToNext()Z
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    goto :goto_0

    :catchall_0
    move-exception v0

    move-object v1, v3

    :goto_2
    if-eqz v1, :cond_4

    invoke-interface {v1}, Landroid/database/Cursor;->close()V

    :cond_4
    throw v0

    :cond_5
    :try_start_3
    invoke-interface {v5}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/String;

    invoke-virtual {v2, v0}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/ninesky/browser/provider/g;

    if-nez v1, :cond_6

    new-instance v1, Lcom/ninesky/browser/provider/g;

    invoke-direct {v1, v0, v4}, Lcom/ninesky/browser/provider/g;-><init>(Ljava/lang/String;I)V

    invoke-virtual {v2, v0, v1}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    goto :goto_1

    :cond_6
    iget v0, v1, Lcom/ninesky/browser/provider/g;->b:I

    add-int/2addr v0, v4

    iput v0, v1, Lcom/ninesky/browser/provider/g;->b:I

    iget v0, v1, Lcom/ninesky/browser/provider/g;->c:I

    add-int/lit8 v0, v0, 0x1

    iput v0, v1, Lcom/ninesky/browser/provider/g;->c:I
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_0

    goto :goto_1

    :catchall_1
    move-exception v1

    move-object v6, v1

    move-object v1, v0

    move-object v0, v6

    goto :goto_2
.end method
